<template>
    <a href="/">注册</a>
    <h2>显示</h2>
    姓名
    <input type="text" v-model="querry.name">

    状态
    <select v-model="querry.zt">
                    <option value="0">请选择</option>
                    <option value="1">启用</option>
                    <option value="2">禁用</option>
                </select>
    会员等级
    <select v-model="querry.hydj">
                    <option value="0">请选择</option>
                    <option value="1">VIP</option>
                    <option value="2">超级VIP</option>
                </select>
        
    <input type="button" value="查询" @click="querys">
    <table>
        <thead>
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>手机号</th>
                <th>会员等级</th>
                <th>消费金额</th>
                <th>消费次数</th>
                <th>可用积分</th>
                <th>可用余额</th>
                <th>启用状态</th>
                <th>日期</th>
            </tr>
        </thead>
        <tbody>
            <tr v-for="a in data">
                <th>{{a.uid}}</th>
                <th>{{a.uname}}</th>
                <th>{{a.sex==true?"男":"女"}}</th>
                <th>{{a.phone}}</th>
                <th>{{a.huiyuan}}</th>
                <th>{{a.jine}}</th>
                <th>{{a.chishu}}</th>
                <th>{{a.jifen}}</th>
                <th>{{a.yue}}</th>
                <th>{{a.zhuangtai==1?"开启":"关闭"}}</th>
                <th>{{a.time}}</th>
            </tr>
        </tbody>
    </table>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref,onMounted } from 'vue';
import moment from 'moment';
import { useRoute } from 'vue-router';

const route=useRoute()

onMounted(()=>{
    shoow()
})
const querry=ref({
    "name":"",
    "zt":0,
    "hydj":0
})


const data=ref([{
  "uid": 0,
  "uname": "",
  "sex": true,
  "phone": "",
  "huiyuan": 0,
  "jine": "",
  "chishu": "",
  "jifen": "",
  "yue": "",
  "zhuangtai": 0,
  "time": ""
}])

const querys=()=>{
    shoow()
}

const shoow=()=>{
    axios.get("https://localhost:7182/api/VS/Show",{params:querry.value}).then(res=>{
        data.value=res.data
    })
}

</script>

<style scoped>

</style>